﻿(function ($) {
    $.fn.openDialog = function (op) {
        openDialogDefaults = $.extend({}, openDialogDefaults, op);
        openDialogDefaults.content = "<iframe scrolling='auto' frameborder='0' src='" + op.url + "' style='width:100%; height:100%; display:block;'></iframe>";
        //var dd = $('<div id="winFormDialog" class="easyui-dialog"></div>');
        //$('body').append(dd);
        $(this).dialog(openDialogDefaults).dialog("open");
    };

    var openDialogDefaults = {
        title: 'My Dialog',
        width: 600,
        height: 600,
        closed: false,
        cache: false,
        modal: true,
        inParam: {},
        onClose: function () {
            var data = $("#winFormDialog").dialog('options');
            if (data != undefined && data != null) {
                openDialogDefaults.callback(data);
            }
        }
    };

})(jQuery)